#include <iostream>

using namespace std;


class StaticMem{
	static int istatic;
	static const int icstatic; // = 10; // Initialization is optional
	int i;
	static StaticMem ssm;
	StaticMem *psm;
	// StaticMem sm; // IntelliSense: incomplete type is not allowed, Error C2460: 'StaticMem::sm' : uses 'StaticMem', which is being defined
public:
	static void fstatic(){
		istatic ++;
		// i ++; // IntelliSense: a nonstatic member reference must be relative to a specific object
		cout << "istatic: " << istatic << endl;
		cout << "icstatic: " << icstatic << endl;
	}
	void f(){
		istatic ++;
		i ++;
		cout << "i: " << i << endl;
	}
	void fun(int = istatic){ // Static data member can be used as a default parameter.
	}
};

int StaticMem::istatic = 110;
// int StaticMem::i = 10; // IntelliSense: a nonstatic data member may not be defined outside its class

// If have initialized in class body, this declaration is optional, and in this case, initialization value here will cause a compile error: redefined;
// but if not, this statement is necessary
const int StaticMem::icstatic = 10; 


int main(){

	StaticMem sm;
	sm.fstatic();
	sm.f();


	return 0;
}